
using System;
using System.Drawing;

using MonoTouch.Foundation;
using MonoTouch.UIKit;
using bjeschool_csharp.Model;

namespace bjeschool
{
	public partial class ClassNoteItemList : UIViewController
	{
		public ClassNoteItemList () : base ("ClassNoteItemList", null)
		{
		}
		
		public override void DidReceiveMemoryWarning ()
		{
			// Releases the view if it doesn't have a superview.
			base.DidReceiveMemoryWarning ();
			
			// Release any cached data, images, etc that aren't in use.
		}
		
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			// Perform any additional setup after loading the view, typically from a nib.
			CommonListEx<M_ClassNoteItem, ClassNoteItemListCell> stvc = new CommonListEx<M_ClassNoteItem, ClassNoteItemListCell>(AppDelegate.sqlitedb);
			stvc.HeaderTitle = new string[]{"名称", "类型", "加扣分", "创建时间", "操作"};
			stvc.OnRowSelected += (UITableView tableView, NSIndexPath indexPath) => {
				ClassNoteItemEdit dvc = new ClassNoteItemEdit();
				this.NavigationController.PushViewController(dvc, true);
			};
			this.AddChildViewController(stvc);
			this.View.AddSubview(stvc.View);
		}
		
		public override void ViewDidUnload ()
		{
			base.ViewDidUnload ();
			
			// Clear any references to subviews of the main view in order to
			// allow the Garbage Collector to collect them sooner.
			//
			// e.g. myOutlet.Dispose (); myOutlet = null;
			
			ReleaseDesignerOutlets ();
		}
		
		public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
		{
			// Return true for supported orientations
			return true;
		}
	}
}

